<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<base href="${basePath}">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="../header.jsp">
	<jsp:param value="职位界面" name="title"/>
</jsp:include>
<link href="static/css/teacher.css" rel="stylesheet" type="text/css">
<script src="static/js/jobinfor.js" type="text/javascript"></script>
</head>
<body>
	<div class = "gps">
<a class = "home" href="staff?method=forward">首页</a>
<sapn> > </sapn>	
<a href="job">职位管理</a>
</div>
	<!--搜索区域  -->
	<div class="searcherjob" >
			<form>
				<div class="ui form">
					<div class="fields">
						<div class="field">
							<label>&nbsp</label> 
							<input type="text" name="jobName" value="${param.jobName }" placeholder="检索职位">
						</div>
						<div class="field">
							<label>&nbsp;</label>
							<button class="ui green button">检索</button>
							<a class="ui green button" href="javascript:addposition()">新增</a>
						</div>
					</div> 
				</div>
			</form>
	</div>
		<a class="ui red button" id="deletejob" href="javascript:deletejob()">
			<i class="icon trash"></i> 删除所选
		</a>
<div class="ui cards" id ="allposit">
<c:forEach items="${positionList}" var="datas">
  <div class="card" id = "posti">
    <div class="content">
    	<div class="meta" id = "positlogo">
	    	<input id = "delpos" class="item-check" type="checkbox" value="${datas.positionId}">
	     	<a class="pssita" href="deletejob?id=${datas.positionId}" onclick="return confirm('确认删除？')"><i class="red icon trash"></i></a>
	      	<a class="pssita" href="javascript:changeposition(${datas.positionId},${datas.positionName},${datas.positionDescription});"><i class="write square icon"></i></a>
      	</div>
      	<div class="header"> 
     		 职位：${datas.positionName}
     	 </div>
      <div class="description">
      	描述：
      	<c:if test="${empty datas.positionDescription}">
			他很懒，没有任何描述！
      	</c:if>
      	${datas.positionDescription} 
      </div>
    </div>
  </div>
  </c:forEach>
</div>
	<div class="ui right floated pagination menu" id = "positpage">
  	<c:if test="${totalPage > 1 }">
			<div class="page">
				<a <c:if test="${page!=1}">href="job?page=1${queryString}"</c:if>
					class="${page == 1?'disable':''}">首页</a> <a
					<c:if test="${page!=1}">href="job?page=${page-1}${queryString}"</c:if>
					class="${page == 1?'disable':''}">上一页</a> <a
					<c:if test="${page!=totalPage}">href="job?page=${page+1 }${queryString}"</c:if>
					class="${page == totalPage?'disable':''}">下一页</a> <a
					<c:if test="${page!=totalPage}">href="job?page=${totalPage }${queryString}"</c:if>
					class="${page == totalPage?'disable':''}">尾页</a> <span>
					${page}/${ totalPage} </span>
			</div>
		</c:if>
	</div>
<!--新增职位  -->
<div class="ui modal" id = "addposition">
  <div class="header">
  	 新增职位
  </div>
 <div class="teacher-content">
		<form  method="post" class="ui form create-form" action = "addjob">
		  <div class="field">
		    <label>职位名称</label>
		    <input type="text" name="positionName">
		    <%-- <select>
		    	<c:forEach items="${delList}" var="positionList">
		    		<option value="${positionList.positionId}">${positionList.positionName}</option>
		    	</c:forEach>
		    </select> --%>
		  </div>
		   <div class="field">
		    <label>职位描述</label>
		    <input type="text" name="description"  >
		  </div>
		<div class="actions">
		   <div class="ui red deny button">取消</div>
		   
		   <button class="ui green button">确认<i class="checkmark icon"></i></button>
  		</div> 
		</form>
	</div>  
</div>
<!--更改职位 -->

<div class="ui modal" id = "changeposition">
  <div class="header">
  	 更改职位
  </div>
  	<div class="teacher-content">
		<form  method="post" class="ui form create-form" action = "changejob">
			<div class="field">
			 	<label>职位名称</label>
			 	<input type="text" name="cpositionName" id="cname">
			 	<input type="hidden" name="cpositionId" id="cid">
			</div>
			 	<div class="field">
			 	<label>职位描述</label>
			 	<input type="text" name="cdescription" id="cdescript">
			</div>
			<div class="actions">
			  	<div class="ui red deny button">取消</div>
			 	<button class="ui green button">确认<i class="checkmark icon"></i></button>
	  		</div> 
		</form>
	</div>  
</div>
</body>
</html>